#include "led.h"


unsigned char temp = 0x00;
unsigned char temp_old = 0xff;
void Led_Disp(unsigned char *ucLED)
{
    temp = 0x00;
    temp = ((ucLED[0]<<0)|(ucLED[1]<<1)|(ucLED[2]<<2)|(ucLED[3]<<3)|
           (ucLED[4]<<4)|(ucLED[5]<<5)|(ucLED[6]<<6)|(ucLED[7]<<7));
    if(temp != temp_old)
    {
        P0 = ~temp;
        P2 = (P2 & 0x1f) | 0x80;
        P2 &= 0x1f;
        temp = temp_old;
    }
}

void Led_off()
{
    P0 = 0xff;
    P2 = (P2 & 0x1f) | 0x80;
    P2 &= 0x1f;
    temp_old = 0x00;
}